package com.gpscookie.redpanic;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;

public class RedDot extends Entity {
	protected Paint paint;
	
	public RedDot(float ix, float iy) {
		paint = new Paint();
        paint.setColor(Color.RED);            
        paint.setAntiAlias(true);
        paint.setStyle(Paint.Style.FILL);
        paint.setStrokeWidth(0);
		
		width = radius*2;
		height = width;
		x = ix;
		y = iy;
	}
	
	@Override
	public void draw(Canvas canvas) {
		canvas.drawCircle(x, y, radius, paint);
	}

	@Override
	public void explode() {
		live = false;		
	}
	
	@Override 
	public boolean isOverlapped(Entity other) {
		float left = (radius + other.radius);
		left = left*left;
		float right = (x-other.x)*(x-other.x)+(y-other.y)*(y-other.y);
		return right<left;
	}
	
}
